import apiClient from './api'

export async function getRooms(params = {}) {
  const response = await apiClient.get('/rooms', { params })
  return response.data
}

export async function getRoom(id) {
  const response = await apiClient.get(`/rooms/${id}`)
  return response.data
}

export async function createRoom(roomData) {
  const response = await apiClient.post('/rooms', roomData)
  return response.data
}

export async function updateRoom(id, roomData) {
  const response = await apiClient.put(`/rooms/${id}`, roomData)
  return response.data
}

export async function deleteRoom(id) {
  const response = await apiClient.delete(`/rooms/${id}`)
  return response.data
}
